// 引入微信小程序封装的同步请求文件
import {request} from "../../request/request.js"
//Page Object
Page({
  data: {
    title : "搜索",
    swiper_list : [],  //轮播图
    CatItems    : [],  //分类导航
    floorData   : [],  //图片栏
    
  },
  // 轮播图数据
  getSwiperList:async function(e){   
    const SwiperData = await request({
      url:'/home/swiperdata'
    })
    this.setData({swiper_list : SwiperData})
  },
  //获取分类导航数据
  getCatItems:async function(e){
    const CatItems = await request({
      url:'/home/catitems'
    })
    this.setData({CatItems})
  },
  // 获取楼层数据
  getFloorData:async function(e){
    const floorData = await request({
      url:'/home/floordata'
    })
    this.setData({floorData})
  },
  //options(Object)
  onLoad: function(options) {
      this.getSwiperList()
      this.getCatItems()
      this.getFloorData()
  },
  // 生命周期函数--监听页面初次渲染完成,请求数据
  onReady: function() {
    
  },
  onShow: function() {
    
  },
  onHide: function() {

  },
  onUnload: function() {

  },
  onPullDownRefresh: function() {

  },
  onReachBottom: function() {

  },
  onShareAppMessage: function() {

  },
  onPageScroll: function() {

  },
  //item(index,pagePath,text)
  onTabItemTap:function(item) {

  }
});
  